package cn.ctwing.ws.demo;

import cn.ctwing.ws.client.WSClient;

/**
 * 
 * @author eric
 *
 */
public class WSClientDemo {

	public static void main(String[] args) {

		new WSClient().
		//setHost("ws://192.168.38.116:18181/ws-push")//服务端地址
		setHost("ws://127.0.0.1:9081/ws-push")
		.setAppKey("ttttt")//APP KEY
		.setChannels(3)//通道数
		.setAppSecret("test")//AppSecret
		.onMessage((String chl,String msg)->{
			/**
			 * 接收到数据，并处理数据
			 */
			System.out.println("当前通道:"+chl);
			System.out.println("数据内容:"+msg);
		})
		.run();//开始启动
	}

}
